﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using MsTestUtilities.Utilities;

namespace MsTestUtilities.RowTests
{
    public interface ICustomExpectorTestCaseCollection<T1, E> : IEnumerable<TestCase<T1, E>>
    {
		Expector<T1, E> Given(T1 t1);

		void Evaluate();
	}

	public class CustomExpectorTestCaseCollection<T1, E> : ICustomExpectorTestCaseCollection<T1, E>
    {
		CustomExpectorTestScenarioBuilder<T1, E> _builder;
		private List<TestCase<T1, E>> _testCases = new List<TestCase<T1, E>>();

		public CustomExpectorTestCaseCollection(CustomExpectorTestScenarioBuilder<T1, E> builder)
		{
			_builder = builder;			
		}

		public Expector<T1, E> Given(T1 t1)			
		{			
			var testCase = new TestCase<T1, E>(this);
			testCase.SetPremises(t1);
			_testCases.Add(testCase);
			
			return new Expector<T1, E>(this, testCase);
		}

		public void Evaluate()
		{
			_builder.Evaluate();
		}

		public IEnumerator<TestCase<T1, E>> GetEnumerator()
        {
            return _testCases.GetEnumerator();
        }

        System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
        {
            return GetEnumerator();
        }
    }

    public interface ICustomExpectorTestCaseCollection<T1, T2, E> : IEnumerable<TestCase<T1, T2, E>>
    {
		Expector<T1, T2, E> Given(T1 t1, T2 t2);

		void Evaluate();
	}

	public class CustomExpectorTestCaseCollection<T1, T2, E> : ICustomExpectorTestCaseCollection<T1, T2, E>
    {
		CustomExpectorTestScenarioBuilder<T1, T2, E> _builder;
		private List<TestCase<T1, T2, E>> _testCases = new List<TestCase<T1, T2, E>>();

		public CustomExpectorTestCaseCollection(CustomExpectorTestScenarioBuilder<T1, T2, E> builder)
		{
			_builder = builder;			
		}

		public Expector<T1, T2, E> Given(T1 t1, T2 t2)			
		{			
			var testCase = new TestCase<T1, T2, E>(this);
			testCase.SetPremises(t1, t2);
			_testCases.Add(testCase);
			
			return new Expector<T1, T2, E>(this, testCase);
		}

		public void Evaluate()
		{
			_builder.Evaluate();
		}

		public IEnumerator<TestCase<T1, T2, E>> GetEnumerator()
        {
            return _testCases.GetEnumerator();
        }

        System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
        {
            return GetEnumerator();
        }
    }

    public interface ICustomExpectorTestCaseCollection<T1, T2, T3, E> : IEnumerable<TestCase<T1, T2, T3, E>>
    {
		Expector<T1, T2, T3, E> Given(T1 t1, T2 t2, T3 t3);

		void Evaluate();
	}

	public class CustomExpectorTestCaseCollection<T1, T2, T3, E> : ICustomExpectorTestCaseCollection<T1, T2, T3, E>
    {
		CustomExpectorTestScenarioBuilder<T1, T2, T3, E> _builder;
		private List<TestCase<T1, T2, T3, E>> _testCases = new List<TestCase<T1, T2, T3, E>>();

		public CustomExpectorTestCaseCollection(CustomExpectorTestScenarioBuilder<T1, T2, T3, E> builder)
		{
			_builder = builder;			
		}

		public Expector<T1, T2, T3, E> Given(T1 t1, T2 t2, T3 t3)			
		{			
			var testCase = new TestCase<T1, T2, T3, E>(this);
			testCase.SetPremises(t1, t2, t3);
			_testCases.Add(testCase);
			
			return new Expector<T1, T2, T3, E>(this, testCase);
		}

		public void Evaluate()
		{
			_builder.Evaluate();
		}

		public IEnumerator<TestCase<T1, T2, T3, E>> GetEnumerator()
        {
            return _testCases.GetEnumerator();
        }

        System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
        {
            return GetEnumerator();
        }
    }

    public interface ICustomExpectorTestCaseCollection<T1, T2, T3, T4, E> : IEnumerable<TestCase<T1, T2, T3, T4, E>>
    {
		Expector<T1, T2, T3, T4, E> Given(T1 t1, T2 t2, T3 t3, T4 t4);

		void Evaluate();
	}

	public class CustomExpectorTestCaseCollection<T1, T2, T3, T4, E> : ICustomExpectorTestCaseCollection<T1, T2, T3, T4, E>
    {
		CustomExpectorTestScenarioBuilder<T1, T2, T3, T4, E> _builder;
		private List<TestCase<T1, T2, T3, T4, E>> _testCases = new List<TestCase<T1, T2, T3, T4, E>>();

		public CustomExpectorTestCaseCollection(CustomExpectorTestScenarioBuilder<T1, T2, T3, T4, E> builder)
		{
			_builder = builder;			
		}

		public Expector<T1, T2, T3, T4, E> Given(T1 t1, T2 t2, T3 t3, T4 t4)			
		{			
			var testCase = new TestCase<T1, T2, T3, T4, E>(this);
			testCase.SetPremises(t1, t2, t3, t4);
			_testCases.Add(testCase);
			
			return new Expector<T1, T2, T3, T4, E>(this, testCase);
		}

		public void Evaluate()
		{
			_builder.Evaluate();
		}

		public IEnumerator<TestCase<T1, T2, T3, T4, E>> GetEnumerator()
        {
            return _testCases.GetEnumerator();
        }

        System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
        {
            return GetEnumerator();
        }
    }

    public interface ICustomExpectorTestCaseCollection<T1, T2, T3, T4, T5, E> : IEnumerable<TestCase<T1, T2, T3, T4, T5, E>>
    {
		Expector<T1, T2, T3, T4, T5, E> Given(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5);

		void Evaluate();
	}

	public class CustomExpectorTestCaseCollection<T1, T2, T3, T4, T5, E> : ICustomExpectorTestCaseCollection<T1, T2, T3, T4, T5, E>
    {
		CustomExpectorTestScenarioBuilder<T1, T2, T3, T4, T5, E> _builder;
		private List<TestCase<T1, T2, T3, T4, T5, E>> _testCases = new List<TestCase<T1, T2, T3, T4, T5, E>>();

		public CustomExpectorTestCaseCollection(CustomExpectorTestScenarioBuilder<T1, T2, T3, T4, T5, E> builder)
		{
			_builder = builder;			
		}

		public Expector<T1, T2, T3, T4, T5, E> Given(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5)			
		{			
			var testCase = new TestCase<T1, T2, T3, T4, T5, E>(this);
			testCase.SetPremises(t1, t2, t3, t4, t5);
			_testCases.Add(testCase);
			
			return new Expector<T1, T2, T3, T4, T5, E>(this, testCase);
		}

		public void Evaluate()
		{
			_builder.Evaluate();
		}

		public IEnumerator<TestCase<T1, T2, T3, T4, T5, E>> GetEnumerator()
        {
            return _testCases.GetEnumerator();
        }

        System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
        {
            return GetEnumerator();
        }
    }

    public interface ICustomExpectorTestCaseCollection<T1, T2, T3, T4, T5, T6, E> : IEnumerable<TestCase<T1, T2, T3, T4, T5, T6, E>>
    {
		Expector<T1, T2, T3, T4, T5, T6, E> Given(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6);

		void Evaluate();
	}

	public class CustomExpectorTestCaseCollection<T1, T2, T3, T4, T5, T6, E> : ICustomExpectorTestCaseCollection<T1, T2, T3, T4, T5, T6, E>
    {
		CustomExpectorTestScenarioBuilder<T1, T2, T3, T4, T5, T6, E> _builder;
		private List<TestCase<T1, T2, T3, T4, T5, T6, E>> _testCases = new List<TestCase<T1, T2, T3, T4, T5, T6, E>>();

		public CustomExpectorTestCaseCollection(CustomExpectorTestScenarioBuilder<T1, T2, T3, T4, T5, T6, E> builder)
		{
			_builder = builder;			
		}

		public Expector<T1, T2, T3, T4, T5, T6, E> Given(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6)			
		{			
			var testCase = new TestCase<T1, T2, T3, T4, T5, T6, E>(this);
			testCase.SetPremises(t1, t2, t3, t4, t5, t6);
			_testCases.Add(testCase);
			
			return new Expector<T1, T2, T3, T4, T5, T6, E>(this, testCase);
		}

		public void Evaluate()
		{
			_builder.Evaluate();
		}

		public IEnumerator<TestCase<T1, T2, T3, T4, T5, T6, E>> GetEnumerator()
        {
            return _testCases.GetEnumerator();
        }

        System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
        {
            return GetEnumerator();
        }
    }

}
